<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<table width="100%">
	<tr>
		<td height="40" class="sectionheading bottom-border">
			Category Manager
		</td>
	</tr>
	<tr>
		<td>
			<table class="verdana12blacknormal">
				<tbody>
					<tr>
						<td>
							<s:a
								href="displayAllGeneralCategoryForEdit.htm?categoryId=%{categoryId}"
								cssClass="verdana11greynormal">Edit All</s:a>
						</td>
					</tr>
				</tbody>
			</table>

			<table width="100%">
				<tbody>
					<tr align="left">
						<td>
							<s:a href="showCategoryManager.htm"
								cssClass="verdana11greynormal">Top</s:a>
							<s:set name="id" value="%{categoryId}" />
							<s:iterator value="generalCategoriesNamesList">
										&nbsp;&gt;
										<s:if test="%{#id == categoryId}">
									<font class="verdana11greynormal"> 	<s:property value="categoryName"/>
								</s:if>

								<s:else>
									<s:a cssClass="verdana11greynormal"
										href="showCategoryManager.htm?categoryId=%{categoryId}">
										<s:property value="categoryName" />
									</s:a>
								</s:else>
							</s:iterator>
						</td>
					</tr>
				</tbody>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="Textfiled-border">
				<tbody>
					<tr align="center" height="25">
						<td align="center" bgcolor="#E9E9E9"
							class="right-border verdana12darkgreybold">
							Category
						</td>
						<td align="center" bgcolor="#E9E9E9"
							class="right-border verdana12darkgreybold">
							Active
						</td>
						<td align="center" bgcolor="#E9E9E9"
							class="right-border verdana12darkgreybold">
							Accept
						</td>

						<td align="center" bgcolor="#E9E9E9"
							class="right-border verdana12darkgreybold">
							Teaser
						</td>
						<td align="center" bgcolor="#E9E9E9"
							class="right-border verdana12darkgreybold">
							Sort
						</td>
						<td colspan="2" align="center" bgcolor="#E9E9E9"
							class="verdana12darkgreybold">
							Action
						</td>
					</tr>
					<s:if test="%{generalCategoriesList.size == 0}">
						<tr align="left" height="25">
							<td colspan="6" align="left" bgcolor="#FFFFFF"
								class="verdana12darkgreybold">
								No More Subcategories.
							</td>
						</tr>
					</s:if>
					<s:else>
						<s:iterator value="generalCategoriesList" status="rowstatus">
							<s:set name="classCSS" value="%{'Textfiled-no-border-odd'}"
								var="classCSS"></s:set>
							<s:set name="bgColor" value="%{'#FFFFFF'}" var="bgColor"></s:set>

							<s:if test="#rowstatus.even">
								<s:set var="classCSS" value="%{'Textfiled-no-border-even'}"></s:set>
								<s:set var="bgColor" value="%{'#F8F8F8'}"></s:set>
							</s:if>
							<tr height="30">
								<td width="69%" align="left"
									class="verdana12Greybold right-border"
									bgcolor="<s:property value="%{bgColor}" />">
									&nbsp;
									<s:a href="showCategoryManager.htm?categoryId=%{categoryId}">
										<s:hidden name="categoryId" value="%{categoryId}"></s:hidden>
										<s:property value="categoryName" />
									</s:a>
								</td>
								<td align="center" class="verdana12Greybold right-border"
									bgcolor="<s:property value="%{bgColor}" />" width="8%">
									<s:if test="%{active == false}">
										<img src="../images/no.gif" alt="NO" border="0">
									</s:if>
									<s:if test="%{active == true}">
										<img src="../images/yes.gif" alt="YES" border="0">
									</s:if>
								</td>
								<td align="center" class="verdana12Greybold right-border"
									bgcolor="<s:property value="%{bgColor}" />" width="8%">
									<s:if test="%{accept == false}">
										<img src="../images/no.gif" alt="NO" border="0">
									</s:if>
									<s:if test="%{accept == true}">
										<img src="../images/yes.gif" alt="NO" border="0">
									</s:if>
								</td>
								<td align="center" class="verdana12Greybold right-border"
									bgcolor="<s:property value="%{bgColor}" />" width="8%">
									<s:if test="%{categoryTeaser == false}">
										<img src="../images/no.gif" alt="NO" border="0">
									</s:if>
									<s:if test="%{categoryTeaser == true}">
										<img src="../images/yes.gif" alt="NO" border="0">
									</s:if>
								</td>
								<td align="center" class="verdana12Greybold right-border"
									bgcolor="<s:property value="%{bgColor}" />" width="12%">
									<s:property value="sortOrder" />
								</td>
								<td align="center" class="verdana12Greybold"
									bgcolor="<s:property value="%{bgColor}" />" width="8%">
									<table border="0" cellpadding="0" cellspacing="0" width="80%">
										<tr>
											<td width="40%" valign="top">
												<s:url id="edit" action="setForUpdateGeneralCategory">
													<s:param name="categoryId" value="categoryId"></s:param>
												</s:url>
												<s:a href="%{edit}">
													<img src="../Admin-Images/edit-icon.gif" style="border: 0"
														alt="Edit">
												</s:a>
											</td>
											<td align="center" class="verdana12Greybold" valign="middle"
												bgcolor="<s:property value="%{bgColor}" />" width="40%">
												<s:url id="delete" action="displayAllGeneralCategory">
													<s:param name="categoryId" value="categoryId"></s:param>
												</s:url>
												<s:a href="%{delete}">
													<img src="../Admin-Images/delete-icon.gif"
														style="border: 0" alt="Delete">
												</s:a>
											</td>
										</tr>
									</table>
							</tr>
						</s:iterator>
					</s:else>
				</tbody>
			</table>

			<table>
				<tbody>
					<tr>
						<td>
						</td>
					</tr>

				</tbody>
			</table>

			<s:form method="post" id="form" action="addNewGeneralCategories"
				theme="simple">

				<s:hidden name="categoryTeaser" value="false"></s:hidden>

				<table width="100%">
					<tbody>
						<tr>
							<td>
								&nbsp;
							</td>
						</tr>
						<tr align="left">
							<td align="left" class="verdana12darkgreybold">
								Create New
								<s:if test="%{subCategory == true}">
								SubCategories
								</s:if>
								<s:else>Categories</s:else>
							</td>
						</tr>
					</tbody>
				</table>
				<table width="100%">
					<tbody>
						<tr>
							<td>
								<s:actionerror cssClass="Note-red" />
								<s:fielderror></s:fielderror>
							</td>
						</tr>
						<tr>
							<td colspan="2" width="100%">
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tbody>
										<tr>
											<td align="left" valign="top" class="verdana12blacknormal">
												<p>
													Please enter one category name per line and press enter at
													the end of each line.
													<br>

													Categories will be created under the current category shown
													by the guide bar.
													<br>
													You can create any number of categories.
												</p>
											</td>
										</tr>
										<tr align="left">
											<td>
												<s:a href="showCategoryManager.htm"
													cssClass="verdana11greynormal">Top</s:a>
												<s:set name="id" value="%{categoryId}" />
												<s:hidden name="categoryId" value="%{categoryId}"></s:hidden>
												<s:iterator value="generalCategoriesNamesList">
										&nbsp;&gt;
										<s:if test="%{#id == categoryId}">
														<font class="verdana11greynormal"> <s:property value="categoryName"/>
													</s:if>

													<s:else>
														<s:a cssClass="verdana11greynormal"
															href="showCategoryManager.htm?categoryId=%{categoryId}">
															<s:property value="categoryName"/>
														</s:a>
													</s:else>
												</s:iterator>
											</td>
										</tr>

										<tr>
											<td align="left" align="center" class="verdana12Greybold">
												<s:textarea rows="10" cols="80" name="categoryArea"
													cssClass="Textfiled-border" />
											</td>
										</tr>
										<tr>
											<td>
												&nbsp;
											</td>
										</tr>
										<tr>
											<td align="center" valign="top">
												<s:if test="%{subCategory==true}">
													<s:submit type="image" value="Create Categories"
														src="../Admin-Images/sub-categories-btn.gif"></s:submit>
												</s:if>
												<s:else>
												<s:submit type="image" value="Create Categories"
													src="../Admin-Images/create-categories-btn.gif"></s:submit>
												</s:else>
												<img style="cursor: pointer;"
													onclick="document.getElementById('form').reset();"
													src="../Admin-Images/reset-button.gif" alt="Reset">
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
				</table>
			</s:form>
		</td>
	</tr>
</table>